import type { Metadata } from "next";
import style from "./index.module.scss";
import Header from "@/app/components/Header";
import { getWordTemplateById } from "@/service/oldResume";
import Footer from "@/app/components/Footer";
import RightContent from "./components/RightContent";
export const metadata: Metadata = {};
export default async function Home({ params }) {
  const { id } = params;
  const res = await getWordTemplateById({
    id,
  });
  const data = res.data || {};
  metadata.title = data.template_name
    ?.replace(".docx", "")
    ?.replace(".doc", "");
  metadata.keywords = metadata.title + ",简历模板";
  return (
    <>
      <Header key={"header"} current="fanwen" style={{ background: "#fff" }} />
      <main className={style.main}>
        <div className={style.container}>
          <div className={style.left}>
            <h1 className={style.title}>{data?.template_name}</h1>
            <li className={style.listItem}>
              <div className={style.img}>
                <img src={data.template_img} alt="" width={"100%"} />
              </div>
            </li>
          </div>
          <div className={style.right}>
            <RightContent title={data?.template_name} id={id} />
          </div>
        </div>
        <Footer />
      </main>
    </>
  );
}
